﻿using AMatysiak.Controls;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AMatysiakTest
{
    [TestClass]
    public class FormatLabelTest
    {
        [TestMethod]
        public void testNormalLabel()
        {
            FormatLabel label = new FormatLabel();
            label.Text = "test";

            Assert.AreEqual("test", label.Text);
        }

        [TestMethod]
        public void testTextCreatedOnlyByFormat()
        {
            FormatLabel label = new FormatLabel();
            label.Format = "format";

            Assert.AreEqual("format", label.Text);
        }

        [TestMethod]
        public void testSetText()
        {
            FormatLabel label = new FormatLabel();
            label.Format = "{0}{1}";
            label.SetText("a", "b");

            Assert.AreEqual("ab", label.Text);
        }

        [TestMethod]
        public void testSetTextWithoutFormat()
        {
            FormatLabel label = new FormatLabel();
            label.SetText("a", "b");

            Assert.AreEqual("", label.Text);
        }
    }
}
